{if not isset($iteration)}{assign var="iteration" value=1}{/if}

{if $entries|@count}

<ul style="padding-left: {$iteration*10}px;">
{foreach from=$entries item="item"}
    {assign var=caption value=$item.name|default:"home"}
    <li>
        {if $item.active && $current == $item.id}<span class="active">{$caption}</span>
        {else}<a href="{url query=$item.backend_url}"{if $item.active} class="active"{/if}>{$caption}</a>{/if}
    </li>
    {if $item.children|@count > 0}
        {include file="resource/list.tpl" entries=$item.children iteration=$iteration+1}
    {/if}
{/foreach}
</ul>

{/if}
